using System;
using System.Collections.Generic;
using System.Linq;
using ApiProject.Api.Data;
using ApiProject.Api.Entity;
using ApiProject.Api.PramaModel;
using ApiProject.Api.Repository;
using ApiProject.Api.Uitls;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;

//商品
namespace ApiProject.Api.Controllers
{
    // [Authorize]
    [ApiController]
    [Route("[controller]")]
    public class CommodityController : ControllerBase
    {
        private IRepository<CommodityDetails> _commditydetaRepository;

        public CommodityController(

            IRepository<CommodityDetails> commditydetaRepository
        )
        {
            _commditydetaRepository = commditydetaRepository;
        }

        //所有商品，商品详情
        [HttpGet]
        public dynamic GetCommodity()
        {
            // var sumcommd = _commditydetaRepository.Table.Where(x=>x.UserId==)


            return JsonHelper
                           .Serialize(new
                           {
                               Code = 200,
                               Data = "sumcommd",
                               Msg = "所有的商品sku"
                           });
        }
    }
}
